/*
   Copyright 2012 Sohan Basak

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

function UpdateScoreBoard(score, gear){ 								// This function is called from the script.js file, linked in the game.html file
	canvas2=document.getElementById("ScoreBoard");						// Gets the Scoreboard layer, or canvas
	cxt=canvas2.getContext("2d");
	
	cxt.clearRect(0,0, 100, 480);										//Refreshes the Rectangle

	cxt.font="25px 'Comic Sans MS'"										//set font
	cxt.fillStyle="#5EDD1E";
	cxt.fillText("Score", 0, 40)										// Adding text SCORE
	
	cxt.font="15px Impact";
	cxt.fillStyle="#5368DF"
	
	txt_width=cxt.measureText(score).width								//Getting the width of the text, required for alignment with the "Sticky look"
	cxt.fillText(score, 100-txt_width, 70)								// Applying the above
	
	
	cxt.font="25px 'Comic Sans MS'"
	cxt.fillStyle="#5EDD1E";
	cxt.fillText("Level", 0, 130)
	
	cxt.font="15px Impact"
	cxt.fillStyle="#5368DF"
	
	txt_width=cxt.measureText(gear).width
	cxt.fillText(gear, 100-txt_width, 160)
	
}
